<template>
	<view>

		<view class="title">子组件输入的数据： {{message}}</view>

		<soncom @myclick="baseEvent"></soncom>

		<view class="title">信：</view>
		<input type="text" v-model="text">
		<button @click="toGrandSon">发送</button>
	</view>
</template>

<script>
	import {
		ref,
		toRefs,
		reactive,
		provide
	} from 'vue';
	export default {
		setup() {
			const message = ref("");
			const text = ref("haha");



			const baseEvent = (msg) => {
				console.log(msg);
				message.value = msg.value;
			}
			provide("text", text);
			const toGrandSon = () => {

			}

			return {
				message,
				baseEvent,
				toGrandSon,
				text
			}

		}
	}
</script>

<style scoped>
	.title {
		color: red;
	}
</style>
